package server.controller;

import com.hz.ironc.cloud.thritf.api.UserDto;
import com.hz.ironc.cloud.thritf.api.UserService;
import org.apache.thrift.TException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import server.provider.UserServiceProvider;

/**
 * Created by tfw2302 on 2017/1/19.
 */
@RestController
public class UserController {

    @Autowired
    UserServiceProvider userServiceProvider;

    @RequestMapping(value = "/hello")
    String hello() throws TException {
        UserService.Client us = userServiceProvider.getBalanceUserService();
        UserDto userDto = us.getUser();
        return "hi " + userDto.getUsername();
    }

}
